<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    // 普通面向对象
    class Person{
        constructor(name,age){
            this.name=name;
            this.age=age
        }
        msg(){
            console.log(this.age+this.name)
        }
    }
    let person1=new Person('jiapeng',26)
    person1.msg()
    // 继承
    class VipPerson extends Person{
        constructor(name,age,sex){
            super(name,age)
            this.sex=sex
        }
        showSex(){
            console.log(this.sex)
        }
    }
    let VipPerson1=new VipPerson('贾鹏',26,'男')
    VipPerson1.msg()
    VipPerson1.showSex()


</script>
</html>